import request from '@/utils/request'

export default {
  //根据角色获取权限列表
  reqGetPermissionByRole(roleId) {
    return request({
      url: `/admin/acl/permission/toAssign/${roleId}`,
      method: 'get',
    })
  },

  //给角色分配权限
  reqSavePermissonByRole( roleId, permissionId ) {
    return request({
      url: `/admin/acl/permission/doAssign`,
      method: 'post',
      params: {
        roleId,
        permissionId
      }
    })
  },

  //获取所有权限菜单
  //GET
  reqGetPermissonList() {
    return request({
      url: `/admin/acl/permission`,
      method: 'get'
    })
  },

  //新增权限菜单
  reqSavePermission(data) {
    return request({
      url: `/admin/acl/permission/save`,
      method: 'post',
      data
    })
  }
}
